<?php
class Employ extends Model {
	public function addJob($data) {
		return $this->dbo->insertTableRow('job',$data);
	}
	public function getAllJob() {
		$result = $this->dbo->query("SELECT * FROM job");
		return $result->rows;
	}
	public function getJobDetailById($id) {
		$result = $this->dbo->query("SELECT * FROM job WHERE id='".(int)$id."'");
		return $result->row;
	}
	public function delJobById($id) {
		$result = $this->dbo->query("DELETE  FROM job WHERE id='".(int)$id."'");
		return $result;
	}
	public function updateJobById($id,$data) {
		return $this->dbo->query("UPDATE job SET position='".$this->dbo->escape($data['position'])."',num='".(int)$this->dbo->escape($data['num'])."',location='".$this->dbo->escape($data['location'])."',salary='".$this->dbo->escape($data['salary'])."',expire='".$this->dbo->escape($data['expire'])."',description='".$this->dbo->escape($data['description'])."' WHERE id='".(int)$id."'");
	}
}

?>